
import axios from '@/api/common.js'

// 获取所有角色id
export const getRoleAllList = () => {
  return axios({
    url: 'roles'
  })
}
// 删除指定角色的权限id
export const delRoleRightId = (roleId, rightId) => {
  return axios({
    method: 'delete',
    url: `roles/${roleId}/rights/${rightId}`
  })
}
// 角色授权
export const grandRoleForRight = (roleId, rids) => {
  return axios({
    method: 'post',
    url: `roles/${roleId}/rights`,
    data: { rids }
  })
}
// 添加角色
export const addRoleById = (data) => {
  return axios({
    method: 'post',
    url: 'roles',
    data
  })
}
